import { reqCategoryList } from "@/api/index";

const state = {
    categoryList: [],
};
const mutations = {
    SET_CATEGORYLIST_STATE(state, payload) {
        state.categoryList = payload.categoryList;
    },
};
const actions = {
    async getCategoryList({ commit }) {
        const re = await reqCategoryList();
        commit("SET_CATEGORYLIST_STATE", { categoryList: re });
    },
};

export default {
    namespaced: true,
    mutations,
    actions,
    state,
};
